import axios from "@/http.js";
// 市场服务

// 大盘接口
export const get_grail_index = (params) => {
  return axios.request({
    url: '/market.v1/quota/grailIndex',
    method: 'get',
    params: params
  })
}
//  股票详情
export function get_details(query) {
  return axios({
    url: '/market.v1/quota/getDetail',
    method: 'get',
    params: query
  })
}
// K线接口
export const get_kLine = (params) => {
  return axios.request({
    url: '/market.v1/quota/kLine',
    method: 'get',
    params: params
  })
}
// 分时线接口
export const get_time_line = (params) => {
  return axios.request({
    url: '/market.v1/quota/timeLine',
    method: 'get',
    params: params
  })
}
// 股票交易明细
export const get_stock_trade = (params) => {
  return axios.request({
    url: '/market.v1/quota/stockTrade',
    method: 'get',
    params: params
  })
}
// 盘口信息
export const get_stock_pankou = (params) => {
  return axios.request({
    url: '/market.v1/quota/stockPankou',
    method: 'get',
    params: params
  })
}
// 股票详情数据
export const get_more = (params) => {
  return axios.request({
    url: '/market.v1/quota/getMore',
    method: 'get',
    params: params
  })
}
// 港股经纪盘
export const get_broker = (params) => {
  return axios.request({
    url: '/market.v1/quota/broker',
    method: 'get',
    params: params
  })
}
// 获取市场板块
export const get_market = (params) => {
  return axios.request({
    url: '/market.v1/market/index',
    method: 'get',
    params: params
  })
}
// 获取大盘数据
export const get_quota = (params) => {
  return axios.request({
    url: '/market.v1/quota/index',
    method: 'get',
    params: params
  })
}
// 获取行业板块列表
export const get_plate_list = (params) => {
  return axios.request({
    url: '/market.v1/market/plateList',
    method: 'get',
    params: params
  })
}
// 获取板块详情
export const get_plate_info = (params) => {
  return axios.request({
    url: '/market.v1/market/plateInfo',
    method: 'get',
    params: params
  })
}
// 获取异动股
export const get_ranking = (params) => {
  return axios.request({
    url: '/market.v1/market/getRanking',
    method: 'get',
    params: params
  })
}
// 获取涨跌分布
export const get_gain_distribute = (params) => {
  return axios.request({
    url: '/market.v1/market/gainDistribute',
    method: 'get',
    params: params
  })
}
// 获取资金流向
export const get_amtFlow = (params) => {
  return axios.request({
    url: '/market.v1/market/amtFlow',
    method: 'get',
    params: params
  })
}
// 获取融资融券
export const get_margin_trade = (params) => {
  return axios.request({
    url: '/market.v1/stockType/marginTrade',
    method: 'get',
    params: params
  })
}
// 获取融资融券信息
export const get_finance_question = (params) => {
  return axios.request({
    url: '/market.v1/stockType/financeQuestion',
    method: 'get',
    params: params
  })
}
// 获取热门股票
export const get_popular = (params) => {
  return axios.request({
    url: '/market.v1/stockType/popular',
    method: 'get',
    params: params
  })
}
// 获取新股列表
export const get_ipo_index = (params) => {
  return axios.request({
    url: '/market.v1/IPO/ipoIndex',
    method: 'get',
    params: params
  })
}
// 获取新股详情
export const get_ipo_detail = (params) => {
  return axios.request({
    url: '/market.v1/IPO/ipoDetail',
    method: 'get',
    params: params
  })
}
// 获取市场状态
export const post_open_time = (data) => {
  return axios.request({
    url: '/market.v1/quota/openTime',
    method: 'post',
    data
  })
}
